#include <stdio.h>
#include <string.h>

void delete(char *str,int N){
    int length=strlen(str);
    char *p;
    for (p=&str[0];p<str+length;p++){
        int count=1;
        //printf("%s\n",str);
        //printf("%c\n",*p);
        for (char *q=p+1;q<str+length;q++){
            //printf("123%s\n",q);
            if (*p==*q){
                count++;
                if (count>2){
                    length--;
                    for (char *r=q;r<str+length;r++){
                        //printf("1%c\n",*r);
                        *r=*(r+1);
                    }
                    *(str+length)='\0';
                    //printf("%s\n",str);
                    *q--;
                }
                *(str+length)='\0';    
            }
        }
        
    }
    *(str+length)='\0';
}

void main(){
    char str[101];
    scanf("%s",str);
    delete(str,101);
    printf("%s",str);
}